# 打印完数
def is_perfect_number(n):
    sum = 0
    for i in range(1, n):
        if n % i == 0:
            sum += i
    return sum == n
def print_perfect_numbers(n):
    for i in range(1, n+1):
        if is_perfect_number(i):
            print(i)
    return
print_perfect_numbers(100)
